package demo.Controller;

import cn.springmix.base.lang.entity.ResponseResult;
import cn.springmix.core.annotation.NotAutoResult;
import dto.HelloVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import test.feign.HelloFeignService;

import javax.annotation.Resource;

/**
 * @author xufeng
 * @description: 测试一下包装类 和全局异常
 * @date 2022-04-20 13:47
 */
@Slf4j
@RestController
@RequestMapping
public class TestController {

    @Resource
    private HelloFeignService helloFeignService;

    @GetMapping("/test")
    @NotAutoResult
    public ResponseResult hello() {
        ResponseResult<HelloVo> r = helloFeignService.hello();
        HelloVo helloVo = r.getData();
        return r;
    }


}
